package com.zqh.messagemq.config;

import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
import org.springframework.amqp.support.converter.MessageConverter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Description :
 * @Author :kono淇杭哒、
 * @Create 2021-12-09 22:10
 */
@Configuration
public class RabbitMqConfig{
    /**
     * 配置消息转换器,默认使用的是jdk序列化方式，JDK序列化方式并不合适。我们希望消息体的体积更小、可读性更高
     */
    @Bean
    public MessageConverter jsonMessageConverter() {
        return new Jackson2JsonMessageConverter();
    }

}
